home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
301_400
/
DISK0324
/
DISK0324.ZIP
/
PDEMOENT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-02-21
|
6KB
|
129 lines
Program PDEMOENT; {Copyright R D Ostrander
Ostrander Data Services
5437 Honey Manor Dr
Indianapolis IN 46241
This is a demonstration program for the Turbo Pascal subroutine PTOOLENT
for intelligent field editting. Address any questions to the author at
the above address. }
{ $ C - } { This parameter is optional - the PTOOLENT subroutine will identify
and report Ctrl-Break during field editting. }
{$V-} { This parameter is necessary in order to pass String parameters
of other than 80 characters. }
Var
Data : String [80];
DataI : Integer absolute Data;
DataR : Real absolute Data;
Size : Integer;
Decimals : Integer;
RetCode : Integer;
DataType : Char;
{$I PTOOLENT.INC} {Include statement for PTOOLENT procedure}
BEGIN
ClrScr;
Gotoxy (15,5); Write ('Demonstration of PTOOLENT procedure.');
Gotoxy (15,7); Write ('PTOOLENT and this program are copyrights');
Gotoxy (15,8); Write ('of R D Ostrander');
Gotoxy (15,9); Write (' Ostrander Data Services');
Gotoxy (15,10); Write (' 5437 Honey Manor Dr');
Gotoxy (15,11); Write (' Indianapolis IN 46241');
Delay (5000);
ClrScr;
RetCode := 0;
DataType := ' ';
While (DataType <> 'X')
and (RetCode <> 79) do
Begin
Gotoxy (5, 2);
Write ('What type of data would you like to test? ');
Gotoxy (5, 3);
Write ('S = String');
Gotoxy (5, 4);
Write ('I = Integer');
Gotoxy (5, 5);
Write ('R = Real');
Gotoxy (5, 6);
Write ('X = Exit');
While (DataType <> 'S')
and (DataType <> 'I')
and (DataType <> 'R')
and (DataType <> 'X') do
Begin
Gotoxy (47, 2);
Read (KBD, DataType);
Write (DataType);
DataType := UpCase (DataType);
End;
If DataType <> 'X' then
Begin
Size := 0;
Gotoxy (5, 8);
Write ('What size display area? (1 thru 80)');
Gotoxy (34, 9);
Write ('(Press End to Exit)');
Gotoxy (30, 8);
While ((Size < 1)
or (Size > 80))
and (RetCode <> 79) do
PTOOLENT (Size, 'I', 2, 0, RetCode);
Gotoxy (5, 11);
Decimals := 0;
If (DataType = 'R')
and (RetCode <> 79) then
Begin
Write ('How many decimal places? ');
PTOOLENT (Decimals, 'I', 2, 0, RetCode);
End
else ClrEol;
If RetCode <> 79 then
Begin
Gotoxy (1, 14);
Write ('Editting area below:');
Case DataType of
'S' : Data := 'ABCDEF';
'I' : DataI := 12345;
'R' : DataR := 1.23456789;
End; {Case}
Gotoxy (1, 16);
ClrEol;
LowVideo;
PTOOLENT (Data, DataType, Size, Decimals,
RetCode);
NormVideo;
Gotoxy (1, 19);
Write ('Output is: ');
ClrEol;
Case DataType of
'S' : Write ('(', Data, ')');
'I' : Write ('(', DataI:Size, ')');
'R' : Write ('(', DataR:Size:Decimals,
')');
End; {Case}
Gotoxy (1, 20);
ClrEol;
Write ('Data Type is: ', DataType);
Gotoxy (1, 21);
ClrEol;
Write ('Size is: ', Size);
If DataType = 'R' then
Write ('.', Decimals);
Gotoxy (1, 22);
ClrEol;
Write ('Return Code is: ', RetCode);
DataType := ' ';
RetCode := 0;
End;
End;
End;
Gotoxy (1,24);
END.